CFLAGS = -Wall -fpic -coverage -lm

rngs.o: rngs.h rngs.c
	gcc -c rngs.c -g  $(CFLAGS)

dominion.o: dominion.h dominion.c rngs.o
	gcc -c dominion.c -g  $(CFLAGS)

playdom: dominion.o playdom.c
	gcc -o playdom playdom.c -g dominion.o rngs.o $(CFLAGS)

dominionunit: DominionUnit.c dominion.o rngs.o testhelpers.o
	gcc -o dominionunit -g  DominionUnit.c dominion.o rngs.o testhelpers.o $(CFLAGS)

testhelpers.o: testhelpers.h testhelpers.c
	gcc -c testhelpers.c -g $(CFLAGS)

interface.o: interface.h interface.c
	gcc -c interface.c -g  $(CFLAGS)

player: player.c interface.o
	gcc -o player player.c -g  dominion.o rngs.o interface.o $(CFLAGS)

all: playdom player dominionunit dominiontests

testdominion:  testdominion.c dominion.o rngs.o testhelpers.o
	gcc -o testdominion -g  testdominion.c dominion.o rngs.o testhelpers.o $(CFLAGS)

dominiontests: testdominion
	rm -f testdominion.out gameresults.out
	testdominion 1> testdominion.out 2> gameresults.out

clean:
	rm -f *.o playdom.exe playdom test.exe test player player.exe testDrawCard testDrawCard.exe testBuyCard testBuyCard.exe badTestDrawCard badTestDrawCard.exe testdominion testdominion.exe *.gcov *.gcda *.gcno *.so
